/*
 * TeacherList.cpp
 *
 *  Created on: 13 May 2010
 *      Author: Savramis Sartios
 */

#include "TeacherList.h"
#include "../../Iterators/TeacherIterator/TeacherIterator.h"

TeacherList::TeacherList() {
	teachers_=new vector<ITeacher*>;

}

TeacherList::~TeacherList() {
/*	for(int i=0;i<teachers_->size();i++){
		delete teachers_->at(i);
	}*/
	delete teachers_;
}

bool	TeacherList::addTeacher(ITeacher *teacher){
	if(0!=teacher){
		teachers_->push_back(teacher);
		return true;
	}
	throw;
}

bool	TeacherList::setTeachers(const vector<ITeacher*>	*teachers){
	if(0!=teachers){
		teachers_=const_cast<vector<ITeacher*>	*>(teachers);
		return true;
	}
	throw;
}

ITeacherIterator	*	TeacherList::getIterator(){
	ITeacherIterator *it =new TeacherIterator((ITeacherList *)this);
	return it;
}

vector<ITeacher*>::iterator		TeacherList::getBegin(){
	return	teachers_->begin();
}

vector<ITeacher*>::iterator		TeacherList::getEnd(){
	return	teachers_->end();
}

int	TeacherList::count(){
	return	teachers_->size();
}
